home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Utilities / System Utility / ShowSizes / Read Me next >
Text File  |  1992-05-31  |  13KB  |  174 lines

  1.  
  2.  
  3.  
  4.  
  5. Welcome to the world of hard disk maintenance.  ShowSizes allows you to determine where all the space on your hard disk went.  It is an eternal question that we all ask.  I originally wrote it soon after I got my first 20MB Micah drive for my first Mac Plus.  Version 2 was a complete rewrite using THINK Pascal and the Think Class Library.
  6.  
  7. ShowSizes II is $20 Shareware. See the notice near the end of this document.
  8.  
  9. ShowSizes is a fairly simple program.  It scans your hard disk and displays the structure much like the Finder does.  It displays each folder with a bar chart and text displaying the percentage it and its descendants occupy.  This percentage display is configurable to be either the percent of the parent folder, the percent of the total disk that it occupies, the percent of the folder that is wasted, the percent of the parent’s wasted space, or the percent of the total wasted space. Both the bar and text displays can be suppressed if desired.
  10.  
  11. The basic ShowSizes window is laid out like so:
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. In this window, both Bar and Text options are on.  As such, each folder’s percentage is displayed as a bar and overlayed by the text displaying the size of the bar.  In this example the percent of the parent display was chosen, with the result that all folders add up to 100%.  The header shows, on the left, the number of folders and sub-folders contained in the window.  In the center is the size of all files in the folder and sub-folders.  On the right is the number of files in this folder and its sub-folders.  This header display will also change if clicked on.
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. The header changes to a display of the folders in the immediate window on the left, size of files here in the center, and the disk’s free space on the right.  Clicking on it again will change the header back.
  48.  
  49. In addition, there is a single tree-like view of the entire hard disk available.  It can display any of the available percentages, with or without the bar and text labels.  In addition, it can be reduced to only display certain levels of the disk tree by clicking on the column to the left of the one you wish displayed. In other words, you get to see the children of the column you click on.  The display will become smaller when you reduce it, so it may be necessary to scroll upwards and to the left to see it.  Choosing the menu item Show All Levels will return the tree display to its maximum size and will display all nodes.  The following illustration shows a tree with Text turned off.
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. The percent of parent folder calculation displays the size of a folder and all its sub-folders divided by the size of its parent folder and all its sub-folders.  It is really pretty simple.  All the items in a folder add up to 100 percent.  This is also the principle behind the percent of parent’s wasted space display.
  71.  
  72. The percent of total disk calculation displays the sizes as their respective portions of the entire disk.  On large volumes this becomes vanishingly small, so its use is limited to relatively large folders or small volumes.
  73.  
  74. The wasted percentage is calculated as shown in the following diagram. 
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. The three wasted views are 1) percent wasted, 2) percent of parent’s wasted space, and 3) percent of total wasted space.  The first is kind of relative since it is only valid for one folder or file set.  Different folders do not relate to each other in size.  For example, one folder could be 50% wasted if it was a 4K file with only 2K in it, while another folder could be 30% wasted with a 100K file and only 60K used.  The 50% is 2K wasted, while the 30% is 30K.  In order to see the relative wasted sizes you should use option 2, which displays the “normal” ShowSizes view for wasted space with all items in a window adding up to 100%.  The third wasted view shows each item as its percentage of the total wasted space.
  85.  
  86. The whole wasted space concept came about as a result of my aquisition of a 600 megabyte disk drive.  I found that the minimum file size was 9K, as opposed to 512 bytes on a floppy and 1.5K on a my old 80MB drive.  I wondered how much of my large drive was going to waste as a result of this large allocation block size.  I rewrote ShowSizes to include this display.
  87.  
  88. With regards to fixing the wasted disk space, there are really only two options.  The first and simplest is to use a compression utility like Disk Doubler, StuffIt, or Compactor to combine a bunch of small files into larger files. This will reduce the amount of wasted space on your disk.  The other option is to use your disk driver software to create several volumes on your drive.  Note that you must use a low level partitioning method, not SUM’s “soft” partitioning, which just allocates a chunk of disk space for the new volume but doesn’t change the minimum allocation block. Software like SilverLining actually creates several volumes on the drive itself.  Apple’s software also does low level partitioning.  Check with your driver manufacturer for details on its partitioning software.
  89.  
  90. Finally, there is a View in Bytes mode which simply displays the folders and their sizes in bytes.  Notice that in this mode there is no basis for drawing a percentage bar, so there is no bar present, regardless of its setting.
  91.  
  92. You can also call up info on any folder or file icon.  Simply click on an icon and select Get Info from the File menu.  A window like the following will appear:
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. This example is somewhat special as it includes the top level information.  Sub-folders will have slightly less information.  In the percentages there are two numbers, the first being the percentage for that folder and all its sub-folders and the second being for the files directly in that folder.
  116.  
  117. After playing with this for a while, I realized that the Size Here and Size Below should always add up to the Physically Used value.  Since the Size Here and Size Below values are computed as a sum of all the files on the disk and the Physically Used value was maintained by the file system, this would provide a valuable sanity check to make sure that things are kosher. I now do this check and display the following alert if these values do not match.
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. What does this really mean?  It means that there is space used on your disk that is not accounted for. This usually occurs during a crash or similar system malfunction.  While this problem is not immediately serious, it should be treated as such since it will only get worse.  Sometimes ShowSizes will notice this condition before Norton or SUM and they will give the disk a clean bill of health. In this case you would probably be smart to reformat your disk and put everything back on it from a backup. You can probably back a disk up in this condition since that will only back up the files and not the invalid directory or header information.  I have found this check to be very useful on my own disks and it has alerted me to problems before I would have noticed otherwise.
  137.  
  138. All windows are printable to all printers.  How’s that for service?
  139.  
  140. There are a number of other features that are copied from the Finder.  Double-clicking on the title bar will open the window of the parent folder. If your Finder doesn’t do this you need to turn on the bit in the LAYO resource that enables this.  You can use RedEdit, Layout, or Norton’s Layout Plus to do this if and only if you are running system 6.0.x.  System 7 uses a different technique. You can also Option click on the close box to close all the windows, except for the top level window which will remain open.  Closing the top level window closes all the other windows for that disk.
  141.  
  142. Under the New and Open menu items in the File menu is an item called Update.  It will only be available if the currently open file’s disk is mounted and the file has been saved.  As far as this is concerned, the disk is the same if it has the same name and the same size.
  143.  
  144. There is a Save As Text… item under the File menu.  It saves a tab delimited text file of all the relevant data from the current document.  It includes a header identifying all the fields.  It is suitable for importing into Excel or another spreadsheet program.  Note that each line may be over 255 characters, so this file may not be suitable for some simpler programs.  I have included this because I could.  I suppose it may be useful to track changes to a disk.  I can’t imagine bothering.
  145.  
  146. Finally, I added a cool feature that solves a problem I have been having, but it only works under System 7.  What it does is allow you do bring up the Finder window for any window you are looking at in ShowSizes. All you have to do is select a folder in ShowSizes and choose the Finder Window menu item. The Finder will come to the front and the folder's window will open.  Too cool! You can then examine the individual files and/or throw things in the trash. Any changes will not be noticed by ShowSizes until you rescan the disk though. This can be done with the Update menu item. A simple shortcut to get to the Finder window is to hold the option key down and double click on a folder to bring up the corresponding Finder window.  This magic is brought to you by FinderEvents, the custom AppleEvents that the System 7 Finder understands. ShowSizes is AppleEvent aware, although it only supports the required AppleEvents.
  147.  
  148. For you ResEdit hackers out there, ShowSizes has its own custom LAYO which contains all those nifty settings that might live in a customizable preferences file if I were so inclined. Instead I threw them all into the LAYO resource and included a template. Feel free to break things if you are so inclined.
  149.  
  150. ShowSizes II is copyright 1991 by Jon Pugh. It is $20 ShareWare, which means that if you keep it in your toolbox of utilities, I would like you to send me $20.  I know you won’t, but I hope some of you are responsible human beings.  I have a ski habit to support and your checks are sorely needed since lift tickets are near $40 here.
  151.  
  152. Jon Pugh
  153. 20525 Mariani Ave. MS 37A
  154. Cupertino, CA 95014
  155. (408) 862-7094
  156. Internet:    jpugh@apple.com
  157. Applelink:    JONPUGH
  158. AOL: JonPugh
  159.  
  160. Version History:
  161.  
  162. The original version had no number.  It had no scrollbars.  It was feeble, but it worked.
  163.  
  164. Version 2.0 was a first limited release that only went to MacCircles. I thought it was done.
  165.  
  166. Version 2.0.1 fixed an integer overflow (by a simple typecast) on large disks during the check for sufficient disk space during a save.  This release went to Info-Mac and others. I prayed that it was done, but it bombed on SEs and wouldn’t print on them or the Portable.  This version is also missing the header lines on the Portable for an, as yet to be determined, reason.
  167.  
  168. Version 2.0.2 changed the stack increasing method in order to eliminate the crashes and printing problems on the SE and Plus ROMs.  Changed the hilite mode for color hiliting. Added the display of the selection size.  Changed a bunch of drawing stuff so that it looks better.  Fixed the missing header lines problem, although it is still a mystery as to why they were missing. It had something to do with the pen state that PenNormal fixed but wasn’t documented. I also added balloon help for the menus and found that ShowSizes was System 7 compatible. This release went to MacCircles and Info-Mac.
  169.  
  170. Version 2.1 is an upgrade to THINK Pascal 4.0 and TCL 1.1.2 for System 7. I also fixed a bug in the display of the total disk percentages. This shouldn’t have been too obnoxious since the total display shrinks rather rapidly and only one guy noticed. I fixed an annoying update problem that sometimes drew selections wrong after a window was opened. I also added the FinderEvent support and more balloons. I changed the printing so that blank pages wouldn’t print from the tree view. This release also went to MacCircles and Info-Mac. The only known bug is when doing a Save As over an existing file. A duplicate file name error prevents this from working.
  171.  
  172. Version 2.2 fixes the Save As bug (it was a Save As Text bug too), which was really trivial, and changed the selection method to be like the System 7’s Finder, which is an active selection box that hilites folders as it selects them. I also added support for AutoDoubler. Thanks to the people at Salient for the secrets to do this. ShowSizes now shows all files in their compressed state only. I also removed an extra return from the text output. The selection header has a combined percentage added to it. This version went to Info-Mac and a few BBS’s in the SF area.
  173.  
  174. Version 2.2.1 adds a single line of code to output a couple of fields to the text report that were forgotten. Since no one alerted me to this, it must not be getting used.  Bummer.  I changed some of the address info since I am moving.